function a(){
    return new Promise((resovle,reject)=>{
        setTimeout(()=>{
        console.log('aa');
        resovle();
    },1000)
})
}


function b(){
     return new Promise((resovle,reject)=>{ 
    setTimeout(()=>{
        console.log('bb');
        resovle();
    },500)
     })
}

function c(){
    console.log('cc');  
}



Promise.any([a(),b()]).then((res)=>{
    c()
})

function promiseAny(pormises){
    return new Promise((resovle,reject)=>{
        let count = 0;
        let result;
        for(let i=0;i<pormises.length;i++){
            pormises[i].then((value)=>{
                count++;
                result = value;
                if(count === pormises.length){
                    resovle(result);
                }
            }).catch((error)=>{
                reject(error);
            })
        }
    })
}